// 导入request模块
import request from './request'

// 提交焦虑量表(HAMA)
export const submitHamaScale = (assessmentId, answers) => {
  return request.post(`/assessments/${assessmentId}/hama`, {
    answers
  })
}

// 提交抑郁量表(HAMD)
export const submitHamdScale = (assessmentId, answers) => {
  return request.post(`/assessments/${assessmentId}/hamd`, {
    answers
  })
}

// 提交躁狂量表(YMRS)
export const submitYmrsScale = (assessmentId, answers) => {
  return request.post(`/assessments/${assessmentId}/ymrs`, {
    answers
  })
}

// 提交焦虑自评量表(SAS)
export const submitSasScale = (answers) => {
  return request.post('/patient/assessments/submit/sas', {
    answers
  })
}

// 提交抑郁自评量表(SDS)
export const submitSdsScale = (answers) => {
  return request.post('/patient/assessments/submit/sds', {
    answers
  })
}

// 提交焦虑量表(交互量表)
export const submitJiaoLvLiangBiao = (answers) => {
  return request.post('/patient/assessments/submit/jiaolv', {
    answers
  })
}

// 提交躁狂量表(交互量表)
export const submitKuangZaoLiangBiao = (answers) => {
  return request.post('/patient/assessments/submit/kuangzao', {
    answers
  })
}

// 获取量表模板
export const getScaleTemplate = (scaleType) => {
  return request.get(`/scale/templates/${scaleType}`)
}

// 获取评估结果统计
export const getAssessmentStatistics = (timeRange = 'month') => {
  return request.get('/patient/assessments/statistics', {
    time_range: timeRange
  })
}